package com.yunhe.inspect.service;
import com.github.stuxuhai.jpinyin.PinyinException;
import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.model.mybatis.PageResult;
import com.yunhe.inspect.domain.DataInspectOrder;
import com.yunhe.inspect.domain.RectificationSheet;
import com.yunhe.inspect.model.*;

import java.text.ParseException;
import java.util.List;

/**
 * @description 巡检工单表
 * @author misty
 * @date 2021-11-10
 */
public interface DataInspectOrderService {

    /**
     * 新增
     */
    public int createDataInspectOrder (DataInspectOrder dataInspectOrder);

    /**
     * 删除
     */
    public int deleteDataInspectOrder(int id);

    /**
     * 更新
     */
    public int updateDataInspectOrder(DataInspectOrder dataInspectOrder);

    /**
     * 根据主键 id 查询
     * @return
     */
    public DataInspectOrderDetailVo findDataInspectOrderById(int id);

    DataInspectOrderForWechatDTO findDataInspectOrderByIdForWechat(int id);


    void  batchDataInspectOrder(List<DataInspectOrder> dataLists) throws PinyinException;

    PageResult findDataInspectOrder(DataInspectOrderQueryCondition dataInspectOrderQueryCondition) throws ArgumentErrorException;

    void deleteDataInspectOrderByQueryCondition(DataInspectOrderQueryCondition dataInspectOrderQueryCondition) throws ArgumentErrorException;

    void deleteDataInspectOrderByIds(List<Integer> ids) throws ArgumentErrorException;

    void dealDataInspectOrder();

    /**
     * 根据条件获取巡检工单列表(App端)
     * */
    PageResult getDataInspectOrderByConditionApp(InspectOrderAppCondition inspectOrderAppCondition) throws ArgumentErrorException;

    AppDetailVO findDataInspectOrderByIdApp(int inspectOrderId);

    /**
     * 根据条件获取巡检工单列表(微信端)
     * */
    PageResult getDataInspectOrderByConditionForWechat(InspectOrderWechatCondition inspectOrderWechatCondition) throws ArgumentErrorException;

    /**
     * App评审
     * */
    void judge(JudgeBO judgeBO) throws ArgumentErrorException;

    /**
     * App开具整改单
     * */
    void rectifyReform(RectifyReformBO rectifyReformBO) throws ParseException, ArgumentErrorException;

    /**
     * 查看历史整改记录
     * */
    List<RectificationHistoryVO> getRectificationHistory(int inspectOrderId);

    /**
     * App复审
     * */
    void review(ReviewBO reviewBO) throws ArgumentErrorException;

    /**
     * @Description 定时计算剩余天数定时任务（每天凌晨2点执行）
     * @Param
     * @Return
     * @Date 2021/11/15 15:19
     */
    void calculateRemainingDays() throws ParseException;

    /**
     * App评审整改
     * */
    void judgeRectifyReform(RectifyReformBO rectifyReformBO) throws ArgumentErrorException, ParseException;
}